package com.example.content.manager

import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.core.app.ActivityOptionsCompat
import com.example.content.PHOTO_DETAIL_PAGE
import com.example.content.URL_KEY
import com.example.content.activity.MainActivity
import com.example.content.activity.PhotoDetailActivity
import com.example.content.activity.SearchActivity

/**
 * Created by zhudongao
 * Desc
 * Date 2020/10/8
 */
object RouterMgr {

    fun gotoPhotoDetailPage(view:View, url:String) {
        val intent = Intent(
            ActivityMgr.resumeActivity,
            PhotoDetailActivity::class.java
        )
//        val options = ActivityMgr.resumeActivity?.let {
//            ActivityOptionsCompat.makeSceneTransitionAnimation(
//                it, view, PHOTO_DETAIL_PAGE)
//        }
        intent.putExtra(URL_KEY, url)
//        ActivityMgr.resumeActivity?.startActivity(intent, options?.toBundle())
        ActivityMgr.resumeActivity?.startActivity(intent)
    }

    fun gotoMainActivity() {
        ActivityMgr.resumeActivity?.startActivity(Intent(ActivityMgr.resumeActivity, MainActivity::class.java))
    }

    fun searchActivity() {
        ActivityMgr.resumeActivity?.startActivity(Intent(ActivityMgr.resumeActivity, SearchActivity::class.java))
    }
}